//
//  NetworkManager.h
//  ios-loan
//
//  Created by ys on 15/12/2017.
//  Copyright © 2017 hxhg. All rights reserved.
//

#import <Foundation/Foundation.h>
#pragma mark - ////////////////////////////////////////////////////////////////
#pragma mark HttpRequest
typedef enum : NSUInteger {
    HttpGet,
    HttpPost
} HttpMethod;

@interface HttpRequest : NSObject

@property (nonatomic, copy) NSString * urlString;
@property (nonatomic, assign) HttpMethod method;
//post
@property (nonatomic, strong) NSDictionary * body;

+ (instancetype)requestWithMethod:(HttpMethod)method;

//- (void)setUrlWithDefaultHostAndPath:(NSString *)path;

@end


#pragma mark - ////////////////////////////////////////////////////////////////
#pragma mark NetworkManager
@interface NetworkManager : NSObject

+ (void)send:(HttpRequest *)request
completionHandler:(void(^)(id responseObj, NSError *error))completion;

+ (void)upload:(HttpRequest *)request
       files:(NSArray<NSData *> *)files
    progress:(void (^)(NSProgress *uploadProgress))uploadProgressBlock
completionHandler:(void(^)(id responseObj, NSError *error))completion;

+ (void)setToken:(NSString *)token;

+ (void)setDeviceID:(NSString *)deviceID;

+ (void)setRegID:(NSString *)regID;

@end
